<table width="100%" border="0" cellpadding="0" cellspacing="1" class="STYLE1" bgcolor="b5d6e6">
  <tr>
    <td colspan="3" align="left" background='<%=$urr+"skin/images/bg.gif"%>'><img src='<%=$urr+"skin/icon/web_icon_015.gif"%>' width="16" height="16" />
      <span class="STYLE3"><%=@titles %></span></td>
  </tr>
</table>

<fieldset>
  <% form_for(:resource,:url=>{:action => "create" } ,:html=>{:multipart => true}) do |f| %>
    <%= h(flash['notice']) %>
    <p>
      <%= f.label :name,"资源名称" %><br />
      <%= f.text_field :name %>
    </p>

    <p>
      <%= f.label :orders,"顺序" %><br />
      <%= f.text_field :orders %> <%= f.label "1...N的数字" %>
    </p>

     <p>
      <%= f.label :status,"状态" %><br />
      <%=radio_button_tag "resource[status]", "1",true%>是
      <%=radio_button_tag "resource[status]", "0",false%>否
    </p>

    <p>
      <%= f.label :col_id,"所属频道--栏目" %><br />
      <%= select("channel", "id", Channel.find(:all).collect{|i| [ i.name,i.id]}, {}, { "onclick" => remote_function(
            :with => "'channel_id='+value",
            :update => 'next_select',
            :url => { :action => :select_with_ajax } ) })%>
      <span id='next_select'></span>
    </p>

    <p>
      <%= f.label :res_type,"资源类型" %><br />
      <%# f.text_field :res_type %>
      <%=radio_button_tag "resource[res_type]", "1",true%>图集
      <%=radio_button_tag "resource[res_type]", "2",false%>图文
      <%=radio_button_tag "resource[res_type]", "3",false%>小说
    </p>

    <p>
      <%= f.label :is_dy,"图片类型" %><br />
      <%# f.text_field :res_type %>
      <%=radio_button_tag "resource[is_dy]", 0,true%>静态
      <%=radio_button_tag "resource[is_dy]", 1,false%>动态
    </p>

    <p>上传文件<br/><%= file_field 'upload', 'datafile' %></p>

    <p>
      <%= f.label :desc,"描述" %><br />
      <%= f.text_area :desc, :cols => 35, :rows => 8 %>
    </p>

    <p>
      <%= f.submit '确定' %>       &nbsp;&nbsp;&nbsp;&nbsp;<%= button_to "返回列表", :controller => "resources",:action => "index" %>
    </p>
  <% end %>
</fieldset>
